南瓜影视[优].js.bak 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. // 注入全局方法 (仅支持tvbox的js1以及c#版drpy的js0,暂不支持drpy官方py版的js0)
  2. // 注入全局方法 (仅支持tvbox的js1以及c#版drpy的js0,暂不支持drpy官方py版的js0)
  3. // 注入全局方法 (仅支持tvbox的js1以及c#版drpy的js0,暂不支持drpy官方py版的js0)
  4. globalThis.getHeaders = function (input) {
  5. let t = new Date().getTime().toString();
  6. let headers = {
  7. 'version_name': '1.0.6',
  8. 'version_code': '6',
  9. 'package_name': 'com.app.nanguatv',
  10. 'sign': md5('c431ea542cee9679#uBFszdEM0oL0JRn@' + t).toUpperCase(),
  11. 'imei': 'c431ea542cee9679',
  12. 'timeMillis': t,
  13. 'User-Agent': 'okhttp/4.6.0'
  14. };
  15. return headers
  16. }
  17. var rule = {
  18. title: '南瓜影视[优]',
  19. host: 'http://ys.changmengyun.com',
  20. homeUrl: '/api.php/provide/vod_rank?app=ylys&sort_type=month&imei=c431ea542cee9679&id=2&page=1',
  21. url: '/api.php/provide/vod_list?app=ylys&id=fyclassfyfilter&page=fypage&imei=c431ea542cee9679',
  22. detailUrl: '/api.php/provide/vod_detail?app=ylys&imei=c431ea542cee9679&id=fyid',
  23. searchUrl: '/api.php/provide/search_result_more?app=ylys&video_name=**&pageSize=20&tid=0&imei=c431ea542cee9679&page=fypage',
  24. searchable: 2,
  25. quickSearch: 0,
  26. filterable: 1,
  27. filter_url: '&area={{fl.area}}&year={{fl.year}}&type={{fl.class}}&total={{fl.total or "状态"}}&order={{fl.by or "新上线"}}',
  28. filter: 'H4sIAAAAAAAAA+2X0XLSQBSG3yXXXARoKfRVnF5EhyuxzrTVGabDTCtSC21B6wxai9WOLcGxlKC1QjDty2Q38BYmJHvOWZwJdoxe5Y7vPz+bZXf/s2FTSSrL9zaVh/misqw8KGjr60pCWdUe5V10+iN2sufyU63wJD/1rboyq3Qm5Y4no6eUCGq1jm21nOqLoIwMjmaLVXXiABYOZ7fPyxV0IINDf8WGI+IAFg6+/ZJvNdGBDPOo6tJTkGGM3be2WSVjAIOjXOPP3hEHcGnF8/irqq3lNVxU1jLYvhm+qIEHpnpQH/e6ouaDqE3aR3zQw0FnJViymzo7tsR6+QA/40LnV1/Fb/ABxv/wGb8XAHzvzTlvXYjv+QBzbhh8eCPNS5JgjG8Gjh/AXcdgBwYz27A+U4Ba5ZpdlkXNB7o5xby2RjZneGWPrDmb43vEA1JqaiGoTD8SPY16muop1FNUT6KepLqKukr0ZA509yPRs6hnqb6E+hLVM6hnqL6I+iLoSXW6AJ+CGqCoq3Jdna3n5Hputp6V64B00+4Xcct4/ZCZjd+2zCl3+WGXt1viyAPDyTi3xr3n6ECGs9k07EHNMW/F8QR2J7OSUFLRts5jyzZ1tw2J+QDDfNxUNwx0IEfbbnYqriJqPty13cyNbhzBOIIRRDAdbQTP9MnRjpiMD3L4pOTRi9C9GvEi9IBcru51i5erB/8trpFOOr5R4ziHxnleWBf+wX3Jf36R7kuP5VOMDmQ5A8QBLCeIOIAjDbE96Lrzl/qPJP3JK3foq3oc6DjQ0QYaHrXxeEMrkCjXrvnW9pwo+x7xnPHtydgSJzcAOJ2X+87otThYPgTtJBNpP/GzT96ugeUQEQcwOL7/YGdN4gCOtFuEJV2a4ez0QrpH2B/x8V4fawGQM8JqH9n7UzwjAZP+Yo+a2F88iPtL3F/+/v2/9AsqovmovxQAAA==',
  29. headers: {
  30. "User-Agent": "okhttp/4.6.0"
  31. },
  32. timeout: 5000,
  33. class_name: '电视剧&电影&动漫&综艺&海外精选', // /api.php/provide/home_nav
  34. class_url: '2&1&4&3&46',
  35. limit: 20,
  36. play_parse: true,
  37. lazy: `js:
  38. try {
  39. function getvideo(url) {
  40. let jData = JSON.parse(request(url, {
  41. headers: getHeaders(url)
  42. }));
  43. if (jData.code == 1) {
  44. return jData.data.url
  45. } else {
  46. return 'http://43.154.104.152:1234/jhapi/cs.php?url=' + url.split('=')[1]
  47. }
  48. }
  49. if (/,/.test(input)) {
  50. let mjurl = input.split(',')[1]
  51. let videoUrl = getvideo(mjurl);
  52. input = {
  53. jx: 0,
  54. url: videoUrl,
  55. parse: 0,
  56. header: JSON.stringify({
  57. 'user-agent': 'Lavf/58.12.100'
  58. })
  59. }
  60. } else {
  61. let videoUrl = getvideo(input);
  62. if (/jhapi/.test(videoUrl)) {
  63. videoUrl = getvideo(videoUrl);
  64. input = {
  65. jx: 0,
  66. url: videoUrl,
  67. parse: 0,
  68. header: JSON.stringify({
  69. 'user-agent': 'Lavf/58.12.100'
  70. })
  71. }
  72. } else {
  73. input = {
  74. jx: 0,
  75. url: videoUrl,
  76. parse: 0
  77. }
  78. }
  79. }
  80. } catch (e) {
  81. log(e.toString())
  82. }
  83. `,
  84. 推荐: `js:
  85. var d = [];
  86. let html = request(input, {
  87. headers: getHeaders(input)
  88. });
  89. html = JSON.parse(html);
  90. html.forEach(function(it) {
  91. d.push({
  92. title: it.name,
  93. img: it.img,
  94. desc: it.remarks,
  95. url: it.id
  96. })
  97. });
  98. setResult(d);
  99. `,
  100. 一级: `js:
  101. var d = [];
  102. let html = request(input, {
  103. headers: getHeaders(input)
  104. });
  105. html = JSON.parse(html);
  106. html.list.forEach(function(it) {
  107. d.push({
  108. title: it.name,
  109. img: it.img,
  110. desc: it.msg,
  111. url: it.id
  112. })
  113. });
  114. setResult(d);
  115. `,
  116. 二级: `js:
  117. var d = [];
  118. VOD = {
  119. vod_id: input.split('id=')[1]
  120. };
  121. try {
  122. let html = request(input, {
  123. headers: getHeaders(input)
  124. });
  125. html = JSON.parse(html);
  126. let node = html.data;
  127. VOD = {
  128. vod_name: node['name'],
  129. vod_pic: node['img'],
  130. type_name: node['type'],
  131. vod_year: node['year'],
  132. vod_remarks: '更新至: ' + node['msg'] + ' / 评分: ' + node['score'],
  133. vod_content: node['info'].strip()
  134. };
  135. let episodes = node.player_info;
  136. let playMap = {};
  137. if (typeof play_url === 'undefined') {
  138. var play_url = ''
  139. }
  140. episodes.forEach(function(ep) {
  141. let playurls = ep['video_info'];
  142. playurls.forEach(function(playurl) {
  143. let source = ep['show'];
  144. if (!playMap.hasOwnProperty(source)) {
  145. playMap[source] = []
  146. }
  147. playMap[source].append(playurl['name'].strip() + '$' + play_url + urlencode(playurl['url']))
  148. })
  149. });
  150. let playFrom = [];
  151. let playList = [];
  152. Object.keys(playMap)
  153. .forEach(function(key) {
  154. playFrom.append(key);
  155. playList.append(playMap[key].join('#'))
  156. });
  157. let vod_play_from = playFrom.join('$$$');
  158. let vod_play_url = playList.join('$$$');
  159. VOD['vod_play_from'] = vod_play_from;
  160. VOD['vod_play_url'] = vod_play_url
  161. } catch (e) {
  162. log('获取二级详情页发生错误:' + e.message)
  163. }
  164. `,
  165. 搜索: `js:
  166. var d = [];
  167. let html = request(input, {
  168. headers: getHeaders(input)
  169. });
  170. html = JSON.parse(html);
  171. html.data.forEach(function(it) {
  172. d.push({
  173. title: it.video_name,
  174. img: it.img,
  175. desc: it.qingxidu + '/' + it.category,
  176. url: it.id,
  177. content: it.blurb
  178. })
  179. });
  180. setResult(d);
  181. `,
  182. }